home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / mosmllib / Byte.sig < prev    next >
Encoding:
Text File  |  1996-07-03  |  837 b   |  26 lines  |  [TEXT/R*ch]

  1. (* Byte -- SML Standard Library *)
  2.  
  3. exception Ord
  4.  
  5. val chr     : Word8.word -> Char.char
  6. val ord     : Char.char -> Word8.word
  7. val string  : Word8Vector.vector -> string
  8. val extract : Word8Array.array * int * int option -> string
  9.  
  10. (* [chr w] returns the character whose ASCII code is w.
  11.  
  12.    [ord c] returns an 8-bit word holding the ASCII code of character c.
  13.    Raises Ord if there is no ASCII code equivalent to the character.
  14.  
  15.    [string v] returns the string of characters whose ASCII codes are
  16.    held in v.
  17.  
  18.    [extract(a, i, NONE)] returns the string of characters whose ASCII
  19.    codes are held in a[i..length a-1].  Raises Subscript if i<0 or  
  20.    i > length a.
  21.  
  22.    [extract(a, i, SOME n)] returns the string of characters whose ASCII
  23.    codes are held in a[i..i+n-1].  
  24.    Raises Subscript if i<0 or n<0 or i+len > length a.
  25. *)
  26.